Skip to content

dgb: AutoRatchet mint-side share-version ratchet (Phase B pool/share) - #292

Merged
frstrtr merged 1 commit into
masterfrom
dgb/auto-ratchet-mint
Jun 21, 2026
Merged

dgb: AutoRatchet mint-side share-version ratchet (Phase B pool/share)#292
frstrtr merged 1 commit into
masterfrom
dgb/auto-ratchet-mint

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Phase B pool/share, first slice. Ports p2pool-v36 AutoRatchet (mirrors src/impl/ltc/auto_ratchet.hpp) as the DGB mint side that pairs with the already work-weighted accept gate (#249/#289 noted DGB had no mint-side ratchet).

Bucket-2 v36-native shared structure (standardize cross-coin toward the v37 unified form). VOTING tail guard is work-weighted so a mint activation can never outrun the 60%-by-work accept gate.

DGB DIVERGENCE FROM LTC + [decision-needed]: the VOTING-state minted version is a constructor parameter base_version_, NOT the ltc hardcode target-1. Per operator re-scope, DGBs live pre-v36 baseline conforms to frstrtr/p2pool-dgb-scrypt and is OLDER than ltc v35. The exact live value must be confirmed against the oracle before the run-loop wire-in. Until then this module is surface-for-tap (UNWIRED) — no behavior change.

KAT (added to dgb_share_test, no new executable/allowlist churn): thresholds 95/50/2x/60; base_version parameterized (not hardcoded 35); bootstrap mints baseline while voting target; JSON state persists across restart. 4/4 new, 20/20 suite green; build EXIT=0.

HOLD merge (integrator merges on operator push approved).

Port p2pool-v36 data.py AutoRatchet (mirrors src/impl/ltc/auto_ratchet.hpp)
as the DGB mint side that pairs with the already work-weighted accept gate
(#249/#289). Bucket-2 v36-native shared structure, standardized cross-coin
toward the v37 unified form; VOTING tail guard is work-weighted so an
activation can never outrun the 60%-by-work accept gate.

DGB divergence from LTC: the VOTING-state minted version is a constructor
parameter (base_version_), NOT the ltc hardcode target-1. Per operator
re-scope, DGBs live pre-v36 baseline conforms to frstrtr/p2pool-dgb-scrypt
and is OLDER than ltc v35; the exact value is a decision-needed for the
run-loop wire-in. Module is surface-for-tap (unwired) until that lands.

KAT (in dgb_share_test): pins thresholds 95/50/2x/60, proves base_version
is parameterized (not hardcoded 35), bootstrap mints baseline while voting
target, and JSON state persists across restart. 4/4 new, 20/20 suite green.
@frstrtr
frstrtr merged commit 06d55eb into master Jun 21, 2026
29 checks passed
frstrtr added a commit that referenced this pull request Jun 21, 2026
…#293)

The DGB VOTING-state baseline share version was a [decision-needed] held on
PR #292. Resolved against the canonical oracle frstrtr/p2pool-dgb-scrypt
@22761e7 (2026-06-17): data.py:636 Share.VERSION=35, VOTING_VERSION=35,
SUCCESSOR=None, share_versions={35:Share}; networks/digibyte.py:26
SEGWIT_ACTIVATION_VERSION=35. SUCCESSOR=None means 35 is the format the live
node currently mints, so base_version=35 is unambiguous. The "older than LTC"
divergence is the P2P PROTOCOL version (p2p.py VERSION=3501 vs LTC 3503), not
the share version.

New fenced header auto_ratchet_wire.hpp is the single production location of
the baseline constant: make_dgb_ratchet() constructs AutoRatchet(target=36,
base=35) and dgb_select_mint_versions() is the run-loop selector. The
work-weighted tail guard already inside get_share_version keeps mint
activation subordinate to the 60%-by-work accept gate (#249/#289) -- this
seam adds no new policy. base_version stays an explicit constructor param so
the v37 unified shape is clean.

De-staled the [decision-needed] notes in auto_ratchet.hpp and share_test.cpp.
+2 KATs pin the wired constant and bootstrap mint=35/vote=36; dgb_share_test
22/22 green. Surface-for-tap (consensus-bearing version-gate flip), HOLD.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
frstrtr added a commit that referenced this pull request Jun 23, 2026
dgb: AutoRatchet mint-side share-version ratchet (Phase B pool/share)
frstrtr added a commit that referenced this pull request Jun 23, 2026
…#293)

The DGB VOTING-state baseline share version was a [decision-needed] held on
PR #292. Resolved against the canonical oracle frstrtr/p2pool-dgb-scrypt
@22761e7 (2026-06-17): data.py:636 Share.VERSION=35, VOTING_VERSION=35,
SUCCESSOR=None, share_versions={35:Share}; networks/digibyte.py:26
SEGWIT_ACTIVATION_VERSION=35. SUCCESSOR=None means 35 is the format the live
node currently mints, so base_version=35 is unambiguous. The "older than LTC"
divergence is the P2P PROTOCOL version (p2p.py VERSION=3501 vs LTC 3503), not
the share version.

New fenced header auto_ratchet_wire.hpp is the single production location of
the baseline constant: make_dgb_ratchet() constructs AutoRatchet(target=36,
base=35) and dgb_select_mint_versions() is the run-loop selector. The
work-weighted tail guard already inside get_share_version keeps mint
activation subordinate to the 60%-by-work accept gate (#249/#289) -- this
seam adds no new policy. base_version stays an explicit constructor param so
the v37 unified shape is clean.

De-staled the [decision-needed] notes in auto_ratchet.hpp and share_test.cpp.
+2 KATs pin the wired constant and bootstrap mint=35/vote=36; dgb_share_test
22/22 green. Surface-for-tap (consensus-bearing version-gate flip), HOLD.

Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
frstrtr added a commit that referenced this pull request Jun 23, 2026
…mer seam

Re-lands the #294 mint_local_share_with_ratchet helper, which was lost from
master in the #292/#293/#294 stacked squash-merge (no #294 merge commit reaches
origin/master; the primitives dgb_select_mint_versions + create_local_share
survive). This is the consumer adapter DGBWorkSource::MintShareFn binds to
(work_source.hpp:197): on a ShareAccept submission it parses the 80-byte
reconstructed header, asks the live AutoRatchet for the {mint, vote} version
pair, and inserts the share via create_local_share, returning the minted hash
(NULL on a malformed header / fail-closed).

Authored against master createlocal_share signature (authoritative). Duck-typed
on the inputs so the header does not pull the stratum work_source TU in. Pure
adapter: tracker-insertion thread-safety is the caller bind point concern.

KAT (dgb_share_test, no new exe): 80-byte header parse round-trip, short-buffer
fail-closed, and adapter fail-closed + template instantiation drift-guard
against create_local_share. 25/25 green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant